var e = require, t = module, n = exports;

Object.defineProperty(n, "__esModule", {
    value: !0
});

var o = e("GameConfig"), i = e("GameData"), a = e("DataManager"), r = e("UIManager"), s = function() {
    function e() {
        this.isAuth = !1;
    }
    return e.getInstance = function() {
        return this._manager || (this._manager = new e()), this._manager;
    }, e.prototype.init = function() {
        this.doCheck() || (0 < o.GC.authContinueTime && o.GC.authIntervalTime <= this.getIntervalTime() ? (i.GD.continuteTime += o.GC.authContinueTime, 
        a.default.getInstance().save()) : r.default.getInstance().loadPnl("auth"));
    }, e.prototype.reset = function() {
        i.GD.playTime = 0, i.GD.playLastTime = 0, i.GD.continuteTime = 0;
    }, e.prototype.doTimer = function(e) {
        return -1 < (e = void 0 === e ? this.getPlayTime() : e) ? i.GD.playTime < e && (i.GD.playTime += 1, 
        i.GD.playTime >= e && (i.GD.playLastTime = Date.now() - 1e3 * (i.GD.playTime - e), 
        a.default.getInstance().save()), !0) : (i.GD.playTime += 1, !0);
    }, e.prototype.getPlayTime = function() {
        return this.isAuth ? -1 < o.GC.authAfterTime ? o.GC.authAfterTime + i.GD.continuteTime : -1 : -1 < o.GC.authBeforeTime ? o.GC.authBeforeTime + i.GD.continuteTime : -1;
    }, e.prototype.getIntervalTime = function() {
        return Math.floor((Date.now() - i.GD.playLastTime) / 1e3);
    }, e.prototype.doCheck = function(e) {
        return !(-1 < (e = void 0 === e ? this.getPlayTime() : e)) || i.GD.playTime < e;
    }, e._manager = null, e;
}();

n.default = s;